package com.idstrust.wiseone.sg.wisehr.common.connection;

import java.io.Reader; 

import com.ibatis.common.resources.Resources; 
import com.ibatis.sqlmap.client.SqlMapClient; 
import com.ibatis.sqlmap.client.SqlMapClientBuilder; 

public class WOSqlMapConfig {

	private static final SqlMapClient sqlMap;
	
	public SqlMapClient getSqlMapInstance() { 
		return sqlMap; 
	} 
	
	static{
		try {
			String resource = "com/idstrust/wiseone/sg/wisehr/common/conf/WOSqlMapConfig.xml";
			Reader reader = Resources.getResourceAsReader(resource); 
			sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); 
		  } catch (Exception e) { 
			  e.printStackTrace(); 
			  throw new RuntimeException("Error initializing class. Cause:" + e); 
		  } 
	} 
}
